package com.patterns.demo.mediator.mediator;

import com.patterns.demo.mediator.user.User;
import com.patterns.demo.mediator.user.User1;
import com.patterns.demo.mediator.user.User2;

/**
 * Author: SamGroves
 * <p>
 * Description:
 * <p>
 * Date: 2017/12/21
 */
public class MyMediator implements Mediator {

    private User user1;

    private User user2;

    public User getUser1() {
        return user1;
    }

    public User getUser2() {
        return user2;
    }

    @Override
    public void createMediator() {

        user1 = new User1(this);
        user2 = new User2(this);
    }

    @Override
    public void workAll() {
        user1.work();
        user2.work();
    }
}
